Skip to content

rush-resolver-cache-plugin: add pnpm 10 / lockfile v9 compatibility#5749

Open
bmiddha wants to merge 1 commit intomainfrom
bmiddha/resolver-cache-pnpm-10
Open

rush-resolver-cache-plugin: add pnpm 10 / lockfile v9 compatibility#5749
bmiddha wants to merge 1 commit intomainfrom
bmiddha/resolver-cache-pnpm-10

Conversation

@bmiddha
Copy link
Copy Markdown
Member

@bmiddha bmiddha commented Apr 7, 2026

Summary

add pnpm 10 / lockfile v9 compatibility to rush-resolver-cache-plugin

Details

rush-resolver-cache-plugin does not support v9 pnpm lockfile format
support pnpm lockfile format v9 and update tests for v6 and v9 format.

How it was tested

unit tests and manually tested integration with pnpm 10 repo.

Impacted documentation

bmiddha added a commit that referenced this pull request Apr 8, 2026
- Hoist regexes in depPathToFilename to module-level constants
- Unify v6/v9 branches in getDescriptionFileRootFromKey using offset
- Check specifier against packages list instead of regex heuristic
- Extract detectV9Lockfile helper (iterates with early return, no clone)
- Store version on IResolverContext when parsing lockfile keys
- Extract getStoreIndexPath helper in afterInstallAsync
- Use context.version instead of .split() on hot path
- Fix undefined in snapshot test names

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@dmichon-msft dmichon-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor things

bmiddha added a commit that referenced this pull request Apr 8, 2026
- Use readdirSync with { withFileTypes: true } to match only files
- Use lockfile.shrinkwrapFileMajorVersion directly (no cast needed)
- Extract extractNameAndVersionFromKey helper with unit tests
- Add comment explaining why depPathToFilename is inlined vs @pnpm/dependency-path

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add IPnpmVersionHelpers interface with version-specific implementations
  for dep-path hashing, lockfile key format, and store index paths
- Vendor pnpm depPathToFilename from exact source commits for v8, v9, v10
- Organize helpers into pnpm/ subdirectory with shared modules for
  keys (v6/v9), store (v3/v10), depPath (v8/v9/v10), and hash functions
- Detect pnpm major version from rush.json config or lockfile format
- Add v9 lockfile test fixture and integration tests for pnpm 9 and 10
- Add unit tests for detectPnpmMajorVersion, getPnpmVersionHelpersAsync,
  resolveDependencyKey (33 tests total, up from 7)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bmiddha bmiddha force-pushed the bmiddha/resolver-cache-pnpm-10 branch from 396e5a5 to 8bbb017 Compare April 11, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

2 participants